public class EventLogManagerModel extends Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
EventLogManagerModel.MostRecentElementList<E>
This class, extension of the
LinkedList class, implements a specific
linked list that has a limited size, avoids duplicates and has a LIFO behaviour. |
Modifier and Type | Field and Description |
---|---|
private int |
internalFrameNumber
This number counts how many
JInternalFrame get opened during
the current application session. |
private EventLogManagerModel.MostRecentElementList<String> |
recentLogList
This variable, instance of the
MostRecentElementList class, represents a
LinkedList object for managing a limited list of String
representing absolute file paths (paths associated to the last opened files in the
application). |
Constructor and Description |
---|
EventLogManagerModel()
Constructs a new
EventLogMangerModel ,
initialising its instance variables. |
Modifier and Type | Method and Description |
---|---|
void |
addNewInternalFrame()
This method increases by 1 the numeric value of the
internalFrameNumber variable. |
void |
addRecentLog(String path)
Adds a new
String , representing an absolute file path to record, on top of the
recentLogList list. |
private String |
getConfigValue(String configID,
String configKey)
Gets the value of the passed key that resides inside
the configuration file defined by the id passed as parameter.
|
String[] |
getEditorCompletions()
Returns a
String array of all the completions defined in the completions.txt
configuration file. |
List<List<String>> |
getEditorTemplates()
Returns a list of three lists, the first one containing the templates id from
the templates.txt configuration file, the second one containing the relative
begin part of the blocks, the third one containing the relative end part of the blocs.
|
int |
getEventTimestampDistance()
Gets the distance between generated event time-stamp (in seconds)
from the elm.txt configuration file.
|
int |
getInternalFrameNumber()
Returns the numeric value of the
internalFrameNumber variable. |
int |
getRecentListNumber()
Gets the recent list number of documents from the elm.txt configuration file.
|
List<String> |
getRecentLogs()
Returns the first
n elements of the recentLogList list
(instance of the MostRecentElementList class) in a List
list object, or the entire recentLogList if its elements are less than n . |
String |
getXesExtSchemaLocal()
Gets the XESEXT Schema local path stored in the xes.txt config file.
|
String |
getXesExtSchemaUrl()
Gets the XESEXT Schema URL stored in the xes.txt config file.
|
String |
getXesSchemaLocal()
Gets the XES Schema local path stored in the xes.txt config file.
|
String |
getXesSchemaUrl()
Gets the XES Schema URL stored in the xes.txt config file.
|
boolean |
hasRecentLogs()
|
private boolean |
resetConfigFile(String configID)
Resets all the values of the configuration file defined by
the passed id to their respective default values.
|
boolean |
resetElmConfig()
Resets all the values of the elm.txt configuration file.
|
boolean |
resetXesConfig()
Resets all the values of the xes.txt configuration file.
|
private boolean |
setConfigValue(String configID,
String configKey,
String value)
Sets the value of the passed key that resides inside
the configuration file defined by the id passed as parameter,
using the value string.
|
boolean |
setEventTimestampDistance(String eventTimeDist)
Sets the distance between generated event time-stamp (in seconds)
in the elm.txt configuration file using the value passed as parameter.
|
boolean |
setRecentListNumber(String recentNumber)
Sets the recent list number of documents in the elm.txt configuration file
using the value passed as parameter.
|
boolean |
setXesExtSchemaLocal(String xesExtLocal)
Sets the XESEXT Schema local path stored in the xes.txt config file
using the value passed as parameter.
|
boolean |
setXesExtSchemaUrl(String xesExtUrl)
Sets the XESEXT Schema URL stored in the xes.txt config file
using the value passed as parameter.
|
boolean |
setXesSchemaLocal(String xesLocal)
Sets the XES Schema local path stored in the xes.txt config file
using the value passed as parameter.
|
boolean |
setXesSchemaUrl(String xesUrl)
Sets the XES Schema URL stored in the xes.txt config file
using the value passed as parameter.
|
private int internalFrameNumber
JInternalFrame
get opened during
the current application session.
It also acts as an identifier for the new JInternalFrame
frame
just created: the system increases by 1 this number when it creates a new
JInternalFrame
and then uses it as a unique name for the new frame.
On this way, the internal frame has an unique number associated with it and can
be connected to a FooterAreaButton
using this identifier.
JInternalFrame
private EventLogManagerModel.MostRecentElementList<String> recentLogList
MostRecentElementList
class, represents a
LinkedList
object for managing a limited list of String
representing absolute file paths (paths associated to the last opened files in the
application).
The list will be composed by unique items, in order of insert: if we add a string, this will be added to the top of the list; if that string was already in the list, we delete the old one and add the new on top (we move that item on top of the list on this way).
public EventLogManagerModel()
EventLogMangerModel
,
initialising its instance variables.public void addNewInternalFrame()
internalFrameNumber
variable.public int getInternalFrameNumber()
internalFrameNumber
variable.internalFrameNumber
variable.public void addRecentLog(String path)
String
, representing an absolute file path to record, on top of the
recentLogList
list.
If the path was already in the list, the process deletes the old one and add the new on top of the list.
This method simply calls the addNewElement(Object)
method of the recentLogList
, that will implements the explained behaviour.
path
- the String
absolute file path to recordpublic List<String> getRecentLogs()
n
elements of the recentLogList
list
(instance of the MostRecentElementList
class) in a List
list object, or the entire recentLogList
if its elements are less than n
.
The number of how many elements will be included in the returned list is defined by the
elm configuration file. The method uses the getRecentListNumber()
method to get it.n
elements of the recentLogList
list, that contains String
values.EventLogManagerModel.MostRecentElementList
,
LinkedList
public boolean hasRecentLogs()
true
if the recentLogList
has elements, false
otherwise.EventLogManagerModel.MostRecentElementList
private String getConfigValue(String configID, String configKey)
configID
- the id of the configuration file (i.e. the name of the file without extension)configKey
- the key to search inside the fileprivate boolean setConfigValue(String configID, String configKey, String value)
configID
- the id of the configuration file (i.e. the name of the file without extension)configKey
- the key to search inside the filevalue
- the String
value to settrue
if the method correctly set the value, false
otherwise.private boolean resetConfigFile(String configID)
configID
- the id of the configuration file (i.e. the name of the file without extension)true
if the method correctly reset the values, false
otherwise.public String getXesSchemaUrl()
String
representing XES Schema URL stored in the xes.txt config file.public boolean setXesSchemaUrl(String xesUrl)
xesUrl
- the String
value to settrue
if the method correctly set the value, false
otherwise.public String getXesSchemaLocal()
String
representing XES Schema local path stored in the xes.txt config file.public boolean setXesSchemaLocal(String xesLocal)
xesLocal
- the String
value to settrue
if the method correctly set the value, false
otherwise.public String getXesExtSchemaUrl()
String
representing XESEXT Schema URL stored in the xes.txt config file.public boolean setXesExtSchemaUrl(String xesExtUrl)
xesExtUrl
- the String
value to settrue
if the method correctly set the value, false
otherwise.public String getXesExtSchemaLocal()
String
representing XESEXT Schema local path stored in the xes.txt config file.public boolean setXesExtSchemaLocal(String xesExtLocal)
xesExtLocal
- the String
value to settrue
if the method correctly set the value, false
otherwise.public boolean resetXesConfig()
true
if the method correctly reset the values, false
otherwise.public int getRecentListNumber()
public boolean setRecentListNumber(String recentNumber)
recentNumber
- the recent list number of documents to settrue
if the method correctly set the value, false
otherwise.public int getEventTimestampDistance()
public boolean setEventTimestampDistance(String eventTimeDist)
eventTimeDist
- the distance between generated event time-stamptrue
if the method correctly set the value, false
otherwise.public boolean resetElmConfig()
true
if the method correctly reset the values, false
otherwise.public List<List<String>> getEditorTemplates()
List
of three List
of String
defined as described above.public String[] getEditorCompletions()
String
array of all the completions defined in the completions.txt
configuration file.String
array of all the possible completions.